<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
  <!ENTITY dc "http://purl.org/dc/elements/1.1/">
  <!ENTITY dcterms "http://purl.org/dc/terms/">
  <!ENTITY foaf "http://xmlns.com/foaf/0.1/">
  <!ENTITY a "http://xmlns.heustics.org/schema/myelin/0.1/">
  <!ENTITY m "http://xmlns.heustics.org/ontology/myelin/0.1/">
]>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:a="&a;"
  xmlns:f="http://xmlns.4suite.org/ext"
  xmlns:xf="http://www.w3.org/2002/xforms"
  xmlns:fres="http://xmlns.4suite.org/reserved"
  xmlns:l="http://xmlns.heustics.org/schema/i18n/0.1/"
  xmlns:fhttp="http://xmlns.4suite.org/4ss/http"
  xmlns:o="&a;AgentProfile#update-depiction"
  extension-element-prefixes="fhttp"
  exclude-result-prefixes="a f fres fhttp xf l o"
>   
  <xsl:variable name="o:l10n" select="a:get-l10n('&a;AgentProfile#update-depiction')"/> 
  <xsl:variable name="o:params-l10n" select="$o:l10n/l:context[@name='params']/*"/>
  <xsl:variable name="o:hints-l10n" select="$o:l10n/l:context[@name='param-hints']/*"/>
  
  <xsl:template match="a:*[@node-id]" mode="a:main-form-attributes">
    <xsl:attribute name="enctype">multipart/form-data</xsl:attribute>
  </xsl:template>
  
  <xsl:template match="a:base-uri|a:data-uri" mode="a:input-show"/>
  <!-- xsl:template match="a:base-uri|a:data-uri" mode="a:input-hidden"/ -->
  
  <xsl:template match="a:depiction" name="a:new-depiction" mode="a:input-show">
    <div class='input text source'>  
      <div class="key">
        <div>
          <xsl:call-template name="a:label-class-attr"/>
          <span>
            <xsl:value-of select="$o:params-l10n[@key='new-depiction']"/>
          </span>
          <div class="spacer"/>
        </div>        
        <div class='hint'>
          <xsl:call-template name="a:input-hints">
            <xsl:with-param name="hint" select="$o:hints-l10n[@key='new-depiction']"/>
          </xsl:call-template>
          <div class="spacer"/>
        </div>
      </div>      
      <div class='value'>
        <input class='large' type="file" name="depiction"/>
        <div class="spacer"/>
      </div>
      <div class='spacer'/>
    </div>  
  </xsl:template>
  
  <xsl:template match="a:depiction[@uri]" mode="a:input-show">   
    <div class='input text source'>  
      <div class="key">
        <div>
          <xsl:call-template name="a:label-class-attr"/>
          <span>
            <xsl:value-of select="$o:params-l10n[@key='current-depiction']"/>
          </span>
          <div class="spacer"/>
        </div>        
        <div class='hint'>
          <xsl:call-template name="a:input-hints">
            <xsl:with-param name="hint" select="$o:hints-l10n[@key='current-depiction']"/>
          </xsl:call-template>
          <div class="spacer"/>
        </div>
        <div class="spacer"/>
      </div>      
      <div class='value'>
        <img src="{concat(a:format-node-action('show-depiction'),'&amp;modified=',@modified)}" alt="{$o:l10n/l:gentext[@key='depiction-unavailable']}"/>
        <div class="spacer"/>       
      </div>
      <div class='spacer'/>
    </div>   
    <xsl:call-template name="a:new-depiction"/>    
  </xsl:template>
  
</xsl:stylesheet>

